﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PS_HisSpouses.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.PS_HisSpouses" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">

        <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
     
           function onTextChange(sender) {
               if (sender.get_value() == "") {
                   sender.set_text("");
               }
           }
  
        </script>
        </telerik:RadCodeBlock>
    <!-- end of custom head section -->
</head>
<body >
    <form id="mainForm" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
         <!--content start -->
         <!--<div style="background: url(../Images/Buttons/bg.jpg) no-repeat;">-->            
            <table width = "750px">
            <tr>
            <td class ="tableHeader">ประวัติการสมรส<asp:Label ID="lblEmpSeq" runat="server" 
                                    Text='<%# DataBinder.Eval( Container, "DataItem.emp_seq"  ) %>' 
                                    Visible="False"></asp:Label>
                            <asp:Label ID="lblSta" runat="server" Visible="False"></asp:Label>
                            </td>
            </tr>
            </table>
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="btnSearch">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="btnShowAll">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="rcb1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                            <telerik:AjaxUpdatedControl ControlID="rcb1" /> 
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
            <asp:Panel ID="Panel5" runat="server" Height="400px" Width = "780" ScrollBars ="Auto">
                    <telerik:RadGrid 
                            ID="RadGrid1" 
                            runat="server" 
                            AllowAutomaticDeletes="True" 
                            AllowFilteringByColumn="True" 
                            AllowMultiRowEdit="True" 
                            AllowMultiRowSelection="True" 
                            AllowPaging="True" 
                            AllowSorting="True" 
                            AutoGenerateColumns="False" 
                            EnableAJAX="True" 
                            EnableAJAXLoadingTemplate="True" 
                            GridLines="None" 
                            OnItemCommand="RadGrid1_ItemCommand" 
                            Skin="Simple" 
                            Width="750px" onitemcreated="RadGrid1_ItemCreated" 
                            onitemdatabound="RadGrid1_ItemDataBound" CellSpacing="0">
                            <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" 
                                ClientDataKeyNames="spouse_seq" 
                                CommandItemDisplay="Top" 
                                DataKeyNames="spouse_seq" 
                                InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                                NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                                <CommandItemTemplate>
                                    <table width="100%">
                                        <tr>
                                            <td>
                                                <asp:LinkButton ID="cmdAddNew" runat="server" CausesValidation="False" 
                                                    CommandName="InitInsert"                                                    
                                                    Visible="<%# !RadGrid1.MasterTableView.IsItemInserted && RadGrid1.EditIndexes.Count <= 0 %>">
                                        <img style="border:0px;vertical-align:middle;" alt="" 
                                        src="../Images/Buttons/AddRecord.gif" /> เพิ่มประวัติการสมรส</asp:LinkButton>
                                               </td>
                                            <td align="right">
                                                
                                            </td>
                                        </tr>
                                    </table>
                                </CommandItemTemplate>
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="15px" />
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="15px" />
                                </ExpandCollapseColumn>                                
                                <Columns>
                                <telerik:GridEditCommandColumn 
                                        EditText = "คลิกเพื่อแก้ไขรายการ"
                                        ButtonType="ImageButton">
                                         <HeaderStyle HorizontalAlign="Center" Width="15px" />
                                        <ItemStyle HorizontalAlign="Center" Width="15px" />
                                    </telerik:GridEditCommandColumn>
                                    <telerik:GridButtonColumn 
                                        ButtonType="ImageButton" 
                                        CommandName="Delete" 
                                        ConfirmDialogType="RadWindow" 
                                        ConfirmText="ลบข้อมูลที่เลือก?" 
                                        ItemStyle-Width="15" 
                                        Text="คลิกเพื่อลบรายการ" 
                                        UniqueName="column1">
                                        <HeaderStyle HorizontalAlign="Center" Width="15px"/>
                                        <ItemStyle HorizontalAlign="Center" Width="15px"/>
                                    </telerik:GridButtonColumn>
                                <telerik:GridBoundColumn HeaderText="PK"  UniqueName="spouse_seq" DataField="spouse_seq" Visible="false"></telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="PK"  UniqueName="emp_seq" DataField="emp_seq" Visible="false"></telerik:GridBoundColumn>
                                    <telerik:GridTemplateColumn
                                        HeaderText = "ชื่อคู่สมรส"
                                        HeaderStyle-HorizontalAlign ="Center"
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter="true" 
                                        CurrentFilterFunction="Contains" 
                                        ShowFilterIcon="False">
                                    <ItemTemplate>
                                    <%# Eval("PREFIX_name")%> <%# Eval("first_name")%> &nbsp;<%#Eval("last_name")%> 
                                    </ItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn 
                                        DataField="Earning" 
                                        UniqueName="Earning"
                                        AllowFiltering ="false"
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter ="true"
                                        ShowFilterIcon ="false"
                                        HeaderText="มีรายได้" 
                                        CurrentFilterFunction="Contains" >
                                        <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                        <ItemTemplate>
                                            <asp:Image runat="server" ID="EarningImage" Visible='<% #Eval("Earning") %>' 
                                                ImageUrl="../Images/Buttons/Update.gif" AlternateText="Important"/>
                                            &nbsp;
                                        </ItemTemplate>                                        
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridBoundColumn 
                                        DataField="StatusName" 
                                        FilterControlWidth = "100%"
                                        AutoPostBackOnFilter ="true"
                                        ShowFilterIcon ="false"
                                        HeaderText="สถานะ" 
                                        UniqueName="StatusName">
                                        <HeaderStyle HorizontalAlign="Center" Width="150px" />
                                        <ItemStyle Width="150px" />
                                    </telerik:GridBoundColumn>
                                    
                                </Columns>
                                <EditFormSettings                                     
                                    EditFormType="WebUserControl" 
                                    UserControlName="../UserControls/PS_HisSpouses.ascx">
                                    <EditColumn UniqueName="EditCommandColumn1"></EditColumn>
                                </EditFormSettings>
                                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                            </MasterTableView>
                            <ClientSettings AllowColumnHide="True" 
                                AllowColumnsReorder="True" 
                                EnableRowHoverStyle="True" 
                                ReorderColumnsOnClient="True">
                                <Selecting AllowRowSelect="True" 
                                EnableDragToSelectRows="true" />
                                </ClientSettings>
                        </telerik:RadGrid>
            </asp:Panel>
        <br />
    </form>
</body>
</html>
